<template>
  <el-dialog
    style="padding: 0; border-radius: 8px"
    v-model="dialogVisible"
    width="600"
    :show-close="false"
  >
    <!--表头 -->
    <template #header>
      <div class="titleBox">
        <span class="titlespan">{{ title }}</span>
        <span @click="dialogVisible = false">
          <el-icon>
            <Close />
          </el-icon>
        </span>
      </div>
    </template>
    <!-- from表单 -->
    <slot name="from"></slot>
    <slot name="add"></slot>
  </el-dialog>
</template>
<script lang="ts" setup>
import { ref, defineExpose, defineProps } from 'vue';
const title = ref('新增车型');
const dialogVisible = ref(false);

//暴露当前弹窗方法
defineExpose({
  setDialogSwitch(offon: boolean) {
    dialogVisible.value = offon;
  },
});
const props = defineProps(['name']);
console.log(props);
</script>
<style lang="less" scoped>
@import './style/DialogComponents.less';
</style>
